<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE6">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="Author" content="">
		<meta name="Keywords" content="">
		<meta name="Description" content="">
		<link rel="shortcut icon" href="<%=basePath%>favicon.ico">
		<link rel="stylesheet" type="text/css" href="<%=basePath%>css/all_b.css?20161126">
		<title>代理- 用户列表</title>
	</head>
	<body style="" id="bodyModule">
		<jsp:include page="../commons/manage_head.jsp" flush="true"></jsp:include>
		<div style="height: 556px;" id="layout" class="container">
			<div style="display: block;" dom="left" class="sidebar">
				<div cl="5" id="account_nav">
					<div class="box account_nav">
						<h3 class="blue-title">
							<span>账号管理</span><em>数量</em>
						</h3>
						<ul id="nav" class="left_nav">
							<li class="" level="0">
								管理员
								<em id="accounts0">2</em>
							</li>
							<li class="on" level="1">
								分公司
								<em id="accounts1">3</em>
							</li>
							<li class="" level="2">
								股东
								<em id="accounts2">3</em>
							</li>
							<li class="" level="3">
								总代理
								<em id="accounts3">3</em>
							</li>
							<li class="" level="4">
								代理
								<em id="accounts4">3</em>
							</li>
							<li class="" level="5">
								会员
								<em id="accounts5">5</em>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div style="display: block;" id="rightLoader" dom="right"
				class="main-content bet-content">
					<div class="title">
						<a href="javascript:history.go(-1)" id="reback" level="1"
							class="mag-btn1">返回</a>	
					</div>
					<table id="lastweek_tb" class="clear-table base-info"
						width="100%">
						<colgroup>
							<col width="20%">
							<col width="20%">
							<col width="20%">
							<col width="20%">
						</colgroup>
						<thead>
							<tr>
								<th align="center">
									日期
								</th align="center">
								<th>
									注數
								</th align="center">
								<th>
									下注金額
								</th align="center">
								<th>
									盈亏
								</th align="center">
							</tr>
						</thead>
						<tbody>
							<fmt:parseNumber var="dayCount" type="number" value="0" />
							<fmt:parseNumber var="cathecticInt" type="number" value="0" />
							<fmt:parseNumber var="winAmt" type="number" value="0" />
							<c:forEach items="${cathecticList }" var="ca" varStatus="st">
								<c:if test="${st.index < 7 }">
									<fmt:parseNumber var="dayCount" type="number" value="${count +  ca.dayCount }" />
									<fmt:parseNumber var="cathecticInt" type="number" value="${cathecticInt +  ca.cathecticInt }" />
									<fmt:parseNumber var="winAmt" type="number" value="${winAmt +  ca.winAmt - ca.cathecticInt}" />
									<tr>
										<td align="center">
											<a href="javascript:void(0)"
												class="black" bdata="firstCallBack,click,firstCallBack">
												${ca.dateTime }</a>
										</td>
										<td align="center">
											${ca.dayCount }
										</td>
										<td align="center">
											${ca.cathecticInt}
										</td>
										<td class="${ca.winAmt-ca.cathecticInt<0?'red':''}">
											<fmt:formatNumber value="${ca.winAmt-ca.cathecticInt}" pattern="0.##"/>
										</td>
									</tr>
								</c:if>
							</c:forEach>
						</tbody>
						<tfoot class="bg_g1">
							<tr id="thisweek_total" class="alltotal">
								<td>
									上周
								</td>
								<td>
									${dayCount }
								</td>
								<td>
									${cathecticInt }
								</td>
								<td class="${winAmt<0?'red':''}">
									<fmt:formatNumber value="${winAmt}" pattern="0.##"/>
								</td>
							</tr>
						</tfoot>
					</table>
					<table id="thisweek_tb" class="clear-table base-info"
						style="margin-top: 19px;">
						<colgroup>
							<col width="20%">
							<col width="20%">
							<col width="20%">
							<col width="20%">
						</colgroup>
						<thead>
							<tr>
								<th>
									日期
								</th>
								<th>
									注數
								</th>
								<th>
									下注金額
								</th>
								<th>
									盈亏
								</th>
							</tr>
						</thead>
						<tbody>
							<fmt:parseNumber var="dayCount" type="number" value="0" />
							<fmt:parseNumber var="cathecticInt" type="number" value="0" />
							<fmt:parseNumber var="winAmt" type="number" value="0" />
							<c:forEach items="${cathecticList }" var="ca" varStatus="st">
								<c:if test="${st.index >= 7 }">
									<fmt:parseNumber var="dayCount" type="number" value="${dayCount +  ca.dayCount }" />
									<fmt:parseNumber var="cathecticInt" type="number" value="${cathecticInt +  ca.cathecticInt }" />
									<fmt:parseNumber var="winAmt" type="number" value="${winAmt + ca.winAmt - ca.cathecticInt}" />
									<tr class="">
										<td>
											<a href="javascript:void(0)"
												class="black" bdata="firstCallBack,click,firstCallBack">
												${ca.dateTime }</a>
										</td>
										<td>
											${ca.dayCount }
										</td>
										<td>
											${ca.cathecticInt }
										</td>
										<td class="${ca.winAmt-ca.cathecticInt<0?'red':''}">
											<fmt:formatNumber value="${ca.winAmt-ca.cathecticInt}" pattern="0.##"/>
										</td>
									</tr>
								</c:if>
							</c:forEach>
						</tbody>
						<tfoot class="bg_g1">
							<tr id="thisweek_total" class="alltotal">
								<td>
									本周
								</td>
								<td>
									${dayCount }
								</td>
								<td>
									${cathecticInt }
								</td>
								<td class="${winAmt<0?'red':''}">
									<fmt:formatNumber value="${winAmt }" pattern="0.##"/>
								</td>
							</tr>
						</tfoot>
					</table>
				</div>
		</div>
		<div class="footer">
			<div class="marquee">
				<a id="moreNotice" class="more more_announcement"
					href="javascript:void(0)">更多</a>
				<p class="marqueeBox">
					<marquee id="marqueeBox" scrollamount="2">
						欢迎光临...........
					</marquee>
				</p>
			</div>
			<span id="marqueeRefresh" class="hidden">9</span>
			<span id="kefuRefresh" class="hidden"></span>
		</div>
		<script src="<%=basePath%>js/jquery.min.js?20161104"></script>
	</body>
	<script>
	$(function(){
		var i = 0;
	    $('.next').click(function(){
	    	window.location.href = "<%=basePath%>manage/user_list?page=2";
	    });
	    
	    $("#search").click(function(){
	    	var userNo= $("#se_con").val();
	    	window.location.href = "<%=basePath%>manage/user_list?userNo="+userNo;
	    });
	});
	function limitUser(userId){
			if($.trim(userId) == ''){
				alert("用户id没有获取到");
				return;
			}
			$.ajax({
	            type: "POST",
	            url:"<%=basePath%>manage/limit_user",
	            data:{"userId":userId},
	            error: function(request) {
	                alert("Connection error");
	            },
	            success: function(data) {
	            	if(data.resultCode == '0'){
	            		alert("停押成功");
	            		window.location.reload();
	            	}else{
		                alert(data.msg);
	            	}
	            }
	        });
	}
	function limitUserOk(userId){
			if($.trim(userId) == ''){
				alert("用户id没有获取到");
				return;
			}
			$.ajax({
	            type: "POST",
	            url:"<%=basePath%>manage/limit_user_ok",
	            data:{"userId":userId},
	            error: function(request) {
	                alert("Connection error");
	            },
	            success: function(data) {
	            	if(data.resultCode == '0'){
	            		alert("解押成功");
	            		window.location.reload();
	            	}else{
		                alert(data.msg);
	            	}
	            }
	        });
	}
	</script>
</html>